package com.froggyware.tadpole.core;

/**
 * Created by IntelliJ IDEA.
 * User: mst
 * Date: Sep 5, 2011
 * Time: 5:31:17 PM
 * To change this template use File | Settings | File Templates.
 */
public interface Serializer {

    /**
     * Serializes the given object into the chosen format.
     * @param o
     * @return
     */
    byte[] serialize(Object o);


    /**
     * Unserializes the object. Might throw a MigrationException if the serialization fails
     * to start the process of trying to make a square fit into that round hole. 
     * @param data
     * @return
     */
    Object unserialize(byte[] data, Class rootClass) throws MigrationException;

}
